{% if articles %}
    {% for article in articles %}
        {% if ad %}
            {% ifequal forloop.counter 3 %}
                <li>
                    <div class="media">
                        <div class="media-body">
                            <div class="meida-subject"><a href="javascript:void(0); "
                                                          target="_blank">This is a ads</a></div>
                            <p>{{ ad.content }}</p>
                        </div>
                        <div class="meida-comments"><i class="icon-heart"></i>&nbsp;1</div>
                    </div>
                </li>
            {% endifequal %}
        {% endif %}
        <li>
            <div class="media">
                {% if article.imgs %}
                    <img src="{{ url }}media/image/{{ article.imgs }}"
                         width="300"/>
                {% endif %}
                <div class="media-body">
                    <div class="meida-subject"><a href="/detail/{{ article.id }}"
                                                  target="_blank">{{ article.title|striptags }}</a></div>
                    {% if article.link or article.video %}
                        <p>{{ article.video|safe }}</p>
                        {% load urlize_blank %}
                        <p>{{ article.content }} {{ article.link|urlize_blank|safe }}</p>
                    {% else %}
                        <p>{{ article.content|safe|removetags:"img"|truncatewords:30 }}</p>
                    {% endif %}
                </div>
                <div class="meida-comments"><i class="icon-heart"></i>&nbsp;1</div>
            </div>
        </li>
    {% endfor %}
{% endif %}